package org.xiyu.yee.beacon_anti_phantom.mixin;

import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.monster.Phantom;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.xiyu.yee.beacon_anti_phantom.beacon.BeaconManager;
import org.xiyu.yee.beacon_anti_phantom.Constants;

import java.util.UUID;

@Mixin(Phantom.class)
public class PhantomTickMixin {
    
    @Inject(method = "tick", at = @At("HEAD"))
    private void checkBeaconProtectionOnTick(CallbackInfo ci) {
        // 现在只用于日志记录，实际处理在ServerChunkCacheMixin中
        Phantom phantom = (Phantom) (Object) this;
        
        if (!phantom.level().isClientSide() && phantom.level() instanceof ServerLevel) {
            // 可以在这里添加一些调试信息，但主要逻辑已经移到ServerChunkCacheMixin
        }
    }
}
